.class public Lcom/xingbook/ting/play/MusicService;
.super Landroid/app/Service;

# interfaces
.implements Landroid/media/MediaPlayer$OnCompletionListener;
.implements Landroid/media/MediaPlayer$OnErrorListener;
.implements Landroid/media/MediaPlayer$OnPreparedListener;
.implements Lcom/xingbook/ting/play/c;
.implements Lcom/xingbook/ting/play/i;


# static fields
.field public static s:Lcom/xingbook/ting/play/MusicService;


# instance fields
.field a:Landroid/media/MediaPlayer;

.field b:Lcom/xingbook/ting/play/a;

.field c:Lcom/xingbook/ting/play/g;

.field d:Z

.field e:Ljava/lang/Integer;

.field f:Lcom/xingbook/ting/play/f;

.field g:Lcom/xingbook/ting/play/e;

.field h:Ljava/lang/String;

.field i:Z

.field j:Landroid/net/wifi/WifiManager$WifiLock;

.field final k:I

.field final l:I

.field m:Lcom/xingbook/ting/play/j;

.field n:Landroid/graphics/Bitmap;

.field o:Landroid/content/ComponentName;

.field p:Landroid/media/AudioManager;

.field q:Landroid/app/NotificationManager;

.field r:Z

.field private t:Ljava/util/Timer;

.field private u:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/xingbook/ting/play/MusicService;->s:Lcom/xingbook/ting/play/MusicService;

    return-void
.end method

.method public constructor <init>()V
    .locals 3

    const/4 v2, 0x0

    const/4 v1, 0x0

    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    iput-object v2, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    iput-object v2, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    sget-object v0, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    iput-boolean v1, p0, Lcom/xingbook/ting/play/MusicService;->d:Z

    iput-object v2, p0, Lcom/xingbook/ting/play/MusicService;->e:Ljava/lang/Integer;

    sget-object v0, Lcom/xingbook/ting/play/f;->a:Lcom/xingbook/ting/play/f;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->f:Lcom/xingbook/ting/play/f;

    sget-object v0, Lcom/xingbook/ting/play/e;->a:Lcom/xingbook/ting/play/e;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    const-string v0, ""

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    iput-boolean v1, p0, Lcom/xingbook/ting/play/MusicService;->i:Z

    const/16 v0, 0x2329

    iput v0, p0, Lcom/xingbook/ting/play/MusicService;->k:I

    const/16 v0, 0x232a

    iput v0, p0, Lcom/xingbook/ting/play/MusicService;->l:I

    iput-boolean v1, p0, Lcom/xingbook/ting/play/MusicService;->r:Z

    return-void
.end method

.method static synthetic a(Lcom/xingbook/ting/play/MusicService;Ljava/util/Timer;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/ting/play/MusicService;->t:Ljava/util/Timer;

    return-void
.end method

.method private a(Lcom/xingbook/ting/play/g;)V
    .locals 3

    iput-object p1, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    iput-object p1, v0, Lcom/xingbook/ting/play/j;->g:Lcom/xingbook/ting/play/g;

    const/4 v0, 0x0

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_1

    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, " (\u5df2\u6682\u505c)"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Ljava/lang/String;)V

    const-string v0, "com.xingpark.ting.play.musicplayer.action.PAUSED"

    :cond_0
    :goto_0
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v1}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    return-void

    :cond_1
    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_2

    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, " (\u6b63\u5728\u64ad\u653e)"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Ljava/lang/String;)V

    const-string v0, "com.xingpark.ting.play.musicplayer.action.PLAYING"

    goto :goto_0

    :cond_2
    sget-object v1, Lcom/xingbook/ting/play/g;->c:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_3

    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, " (\u51c6\u5907\u4e2d)"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Ljava/lang/String;)V

    const-string v0, "com.xingpark.ting.play.musicplayer.action.PREPARING"

    goto :goto_0

    :cond_3
    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_4

    const-string v0, "com.xingpark.ting.play.musicplayer.action.RETRIEVING"

    goto :goto_0

    :cond_4
    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_5

    const-string v0, "com.xingpark.ting.play.musicplayer.action.STOPPED"

    new-instance v1, Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, " (\u5df2\u505c\u6b62)"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/xingbook/ting/play/MusicService;->b(Ljava/lang/String;)V

    goto :goto_0

    :cond_5
    sget-object v1, Lcom/xingbook/ting/play/g;->f:Lcom/xingbook/ting/play/g;

    if-ne p1, v1, :cond_0

    const-string v0, "com.xingpark.ting.play.musicplayer.action.COMPLETION"

    goto :goto_0
.end method

.method private b(I)V
    .locals 4

    iput p1, p0, Lcom/xingbook/ting/play/MusicService;->u:I

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->t:Ljava/util/Timer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->t:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    :cond_0
    if-nez p1, :cond_1

    :goto_0
    return-void

    :cond_1
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->t:Ljava/util/Timer;

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->t:Ljava/util/Timer;

    new-instance v1, Lcom/xingbook/ting/play/d;

    invoke-direct {v1, p0}, Lcom/xingbook/ting/play/d;-><init>(Lcom/xingbook/ting/play/MusicService;)V

    int-to-long v2, p1

    invoke-virtual {v0, v1, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    goto :goto_0
.end method


# virtual methods
.method a()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    new-instance v0, Landroid/media/MediaPlayer;

    invoke-direct {v0}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/media/MediaPlayer;->setWakeMode(Landroid/content/Context;I)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0, p0}, Landroid/media/MediaPlayer;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0, p0}, Landroid/media/MediaPlayer;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->reset()V

    goto :goto_0
.end method

.method a(I)V
    .locals 5

    const/4 v0, 0x0

    const/4 v1, 0x1

    if-gez p1, :cond_1

    sget-object v0, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    invoke-virtual {p0, v1}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    invoke-virtual {p0, v1}, Lcom/xingbook/ting/play/MusicService;->a(Z)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    sget-object v2, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v2}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    iget-object v2, p0, Lcom/xingbook/ting/play/MusicService;->m:Lcom/xingbook/ting/play/j;

    invoke-virtual {v2, p1}, Lcom/xingbook/ting/play/j;->b(I)Lcom/xingbook/audio/b/b;

    move-result-object v2

    if-nez v2, :cond_2

    :try_start_0
    const-string v0, "\u6ca1\u6709\u53ef\u64ad\u653e\u7684\u97f3\u9891"

    const/4 v1, 0x1

    invoke-static {p0, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Z)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0

    :cond_2
    :try_start_1
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->a()V

    iget-object v3, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    const/4 v4, 0x3

    invoke-virtual {v3, v4}, Landroid/media/MediaPlayer;->setAudioStreamType(I)V

    iget-object v3, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v2}, Lcom/xingbook/audio/b/b;->f()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    invoke-virtual {v2}, Lcom/xingbook/audio/b/b;->f()Ljava/lang/String;

    move-result-object v3

    const-string v4, "http:"

    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_3

    invoke-virtual {v2}, Lcom/xingbook/audio/b/b;->f()Ljava/lang/String;

    move-result-object v3

    const-string v4, "https:"

    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_3

    :goto_1
    iput-boolean v0, p0, Lcom/xingbook/ting/play/MusicService;->i:Z

    invoke-virtual {v2}, Lcom/xingbook/audio/b/b;->u()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    sget-object v0, Lcom/xingbook/ting/play/g;->c:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->p:Landroid/media/AudioManager;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->o:Landroid/content/ComponentName;

    invoke-static {v0, v1}, Lcom/xingbook/ting/play/b;->a(Landroid/media/AudioManager;Landroid/content/ComponentName;)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->prepareAsync()V

    iget-boolean v0, p0, Lcom/xingbook/ting/play/MusicService;->i:Z

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->acquire()V

    goto :goto_0

    :cond_3
    move v0, v1

    goto :goto_1

    :cond_4
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->isHeld()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->release()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_0
.end method

.method a(Landroid/content/Intent;)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "index"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->e:Ljava/lang/Integer;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ting/play/MusicService;->d:Z

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_0

    :cond_2
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->k()V

    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "index"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    goto :goto_0
.end method

.method a(Ljava/lang/String;)V
    .locals 4

    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    const-class v2, Lcom/xingbook/ting/activity/TingPlayAct;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const/high16 v1, 0x1000

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    const/16 v2, 0x232a

    const/high16 v3, 0x800

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    new-instance v1, Landroid/support/v4/app/NotificationCompat$Builder;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;)V

    const-string v2, "\u661f\u5b9d\u4e50\u56ed"

    invoke-virtual {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    invoke-virtual {v1, p1}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    const v2, 0x7f0201b9

    invoke-virtual {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/NotificationCompat$Builder;->setOngoing(Z)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/NotificationCompat$Builder;->build()Landroid/app/Notification;

    move-result-object v0

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->q:Landroid/app/NotificationManager;

    const/16 v2, 0x2329

    invoke-virtual {v1, v2, v0}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    return-void
.end method

.method a(Z)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->c:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    if-eqz p1, :cond_1

    :cond_0
    sget-object v0, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->i()V

    :cond_1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.STOP"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    invoke-static {}, Lcom/xingbook/ting/play/j;->k()V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->stopSelf()V

    return-void
.end method

.method b()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    :cond_0
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->c()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->d()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.PAUSE"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0
.end method

.method b(Ljava/lang/String;)V
    .locals 4

    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    const-class v2, Lcom/xingbook/ting/activity/TingPlayAct;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const/high16 v1, 0x1000

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    const/16 v2, 0x232a

    const/high16 v3, 0x800

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    new-instance v1, Landroid/support/v4/app/NotificationCompat$Builder;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;)V

    const-string v2, "\u661f\u5b9d\u4e50\u56ed"

    invoke-virtual {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    invoke-virtual {v1, p1}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    const v2, 0x7f0201b9

    invoke-virtual {v1, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/NotificationCompat$Builder;->setOngoing(Z)Landroid/support/v4/app/NotificationCompat$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/NotificationCompat$Builder;->build()Landroid/app/Notification;

    move-result-object v0

    const/16 v1, 0x2329

    invoke-virtual {p0, v1, v0}, Lcom/xingbook/ting/play/MusicService;->startForeground(ILandroid/app/Notification;)V

    return-void
.end method

.method b(Z)V
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->stopForeground(Z)V

    if-eqz p1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->reset()V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->isHeld()Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->release()V

    :cond_1
    return-void
.end method

.method c()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->m:Lcom/xingbook/ting/play/j;

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->d()I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->e:Ljava/lang/Integer;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ting/play/MusicService;->d:Z

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->k()V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_2

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->l()V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_0

    sget-object v0, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->j()V

    goto :goto_0
.end method

.method public c(Z)V
    .locals 1

    if-eqz p1, :cond_1

    sget-object v0, Lcom/xingbook/ting/play/e;->b:Lcom/xingbook/ting/play/e;

    :goto_0
    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->j()V

    :cond_0
    return-void

    :cond_1
    sget-object v0, Lcom/xingbook/ting/play/e;->a:Lcom/xingbook/ting/play/e;

    goto :goto_0
.end method

.method d()V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    iput-boolean v2, p0, Lcom/xingbook/ting/play/MusicService;->d:Z

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_0

    sget-object v0, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->pause()V

    invoke-virtual {p0, v2}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    goto :goto_0
.end method

.method e()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->c:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    :cond_0
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->k()V

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->e()I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    :cond_1
    return-void
.end method

.method f()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->e:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->c:Lcom/xingbook/ting/play/g;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_1

    :cond_0
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->k()V

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->f()I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    :cond_1
    return-void
.end method

.method public g()V
    .locals 2

    sget-object v0, Lcom/xingbook/ting/play/e;->c:Lcom/xingbook/ting/play/e;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->c:Lcom/xingbook/ting/play/g;

    sget-object v1, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    if-ne v0, v1, :cond_0

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->j()V

    :cond_0
    return-void
.end method

.method h()V
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Z)V

    return-void
.end method

.method i()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    sget-object v1, Lcom/xingbook/ting/play/e;->c:Lcom/xingbook/ting/play/e;

    if-ne v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    invoke-virtual {v0}, Lcom/xingbook/ting/play/a;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/xingbook/ting/play/e;->a:Lcom/xingbook/ting/play/e;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    :cond_0
    return-void
.end method

.method j()V
    .locals 4

    const/high16 v3, 0x3f80

    const v2, 0x3dcccccd

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    sget-object v1, Lcom/xingbook/ting/play/e;->a:Lcom/xingbook/ting/play/e;

    if-ne v0, v1, :cond_1

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->pause()V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    sget-object v1, Lcom/xingbook/ting/play/e;->b:Lcom/xingbook/ting/play/e;

    if-ne v0, v1, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0, v2, v2}, Landroid/media/MediaPlayer;->setVolume(FF)V

    :goto_1
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->start()V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0, v3, v3}, Landroid/media/MediaPlayer;->setVolume(FF)V

    goto :goto_1
.end method

.method k()V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    sget-object v1, Lcom/xingbook/ting/play/e;->c:Lcom/xingbook/ting/play/e;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    invoke-virtual {v0}, Lcom/xingbook/ting/play/a;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/xingbook/ting/play/e;->c:Lcom/xingbook/ting/play/e;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    :cond_0
    return-void
.end method

.method l()V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->m:Lcom/xingbook/ting/play/j;

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->d()I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    return-void
.end method

.method public m()V
    .locals 1

    sget-object v0, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    iget-boolean v0, p0, Lcom/xingbook/ting/play/MusicService;->d:Z

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->k()V

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->e:Ljava/lang/Integer;

    if-nez v0, :cond_1

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->f()I

    move-result v0

    :goto_0
    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    :cond_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->e:Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    goto :goto_0
.end method

.method public n()Landroid/media/MediaPlayer;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/play/MusicService;->a:Landroid/media/MediaPlayer;

    return-object v0
.end method

.method public o()I
    .locals 1

    iget v0, p0, Lcom/xingbook/ting/play/MusicService;->u:I

    return v0
.end method

.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public onCompletion(Landroid/media/MediaPlayer;)V
    .locals 2

    sget-object v0, Lcom/xingbook/ting/play/g;->f:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->i()I

    move-result v0

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->d()I

    move-result v0

    :goto_0
    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(I)V

    return-void

    :cond_0
    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->f()I

    move-result v0

    goto :goto_0
.end method

.method public onCreate()V
    .locals 3

    const/4 v2, 0x1

    iput-boolean v2, p0, Lcom/xingbook/ting/play/MusicService;->r:Z

    sput-object p0, Lcom/xingbook/ting/play/MusicService;->s:Lcom/xingbook/ting/play/MusicService;

    const-string v0, "wifi"

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/wifi/WifiManager;

    const-string v1, "mylock"

    invoke-virtual {v0, v2, v1}, Landroid/net/wifi/WifiManager;->createWifiLock(ILjava/lang/String;)Landroid/net/wifi/WifiManager$WifiLock;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->j:Landroid/net/wifi/WifiManager$WifiLock;

    const-string v0, "notification"

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->q:Landroid/app/NotificationManager;

    const-string v0, "audio"

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/AudioManager;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->p:Landroid/media/AudioManager;

    invoke-static {p0}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->m:Lcom/xingbook/ting/play/j;

    new-instance v0, Lcom/xingbook/ting/play/h;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->m:Lcom/xingbook/ting/play/j;

    invoke-direct {v0, v1, p0}, Lcom/xingbook/ting/play/h;-><init>(Lcom/xingbook/ting/play/j;Lcom/xingbook/ting/play/i;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/xingbook/ting/play/h;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x8

    if-lt v0, v1, :cond_0

    new-instance v0, Lcom/xingbook/ting/play/a;

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1, p0}, Lcom/xingbook/ting/play/a;-><init>(Landroid/content/Context;Lcom/xingbook/ting/play/c;)V

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->b:Lcom/xingbook/ting/play/a;

    :goto_0
    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0201b9

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->openRawResource(I)Ljava/io/InputStream;

    move-result-object v0

    invoke-static {v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->n:Landroid/graphics/Bitmap;

    new-instance v0, Landroid/content/ComponentName;

    const-class v1, Lcom/xingbook/ting/play/MusicIntentReceiver;

    invoke-direct {v0, p0, v1}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->o:Landroid/content/ComponentName;

    return-void

    :cond_0
    sget-object v0, Lcom/xingbook/ting/play/e;->c:Lcom/xingbook/ting/play/e;

    iput-object v0, p0, Lcom/xingbook/ting/play/MusicService;->g:Lcom/xingbook/ting/play/e;

    goto :goto_0
.end method

.method public onDestroy()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/xingbook/ting/play/MusicService;->s:Lcom/xingbook/ting/play/MusicService;

    sget-object v0, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->i()V

    return-void
.end method

.method public onError(Landroid/media/MediaPlayer;II)Z
    .locals 4

    const/4 v3, 0x1

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "\u64ad\u653e\u51fa\u73b0\u9519\u8bef\uff0c\u8bf7\u7a0d\u7b49..."

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    sget-object v0, Lcom/xingbook/ting/play/g;->b:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    invoke-virtual {p0, v3}, Lcom/xingbook/ting/play/MusicService;->b(Z)V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->i()V

    return v3
.end method

.method public onPrepared(Landroid/media/MediaPlayer;)V
    .locals 2

    sget-object v0, Lcom/xingbook/ting/play/g;->d:Lcom/xingbook/ting/play/g;

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Lcom/xingbook/ting/play/g;)V

    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/xingbook/ting/play/MusicService;->h:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, " (\u6b63\u5728\u64ad\u653e)"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->a(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->j()V

    return-void
.end method

.method public onStartCommand(Landroid/content/Intent;II)I
    .locals 3

    invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "com.111.xingpark.ting.play.musicservice.action.STOP"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    const-string v1, "com.111.xingpark.ting.play.musicservice.action.ACTION_SHUTDOWN_DELAY"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    iget-boolean v1, p0, Lcom/xingbook/ting/play/MusicService;->r:Z

    if-eqz v1, :cond_0

    new-instance v1, Landroid/content/Intent;

    const-string v2, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v1}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/xingbook/ting/play/MusicService;->r:Z

    :cond_0
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.TOGGLE_PLAYBACK"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->b()V

    :cond_1
    :goto_0
    const/4 v0, 0x2

    return v0

    :cond_2
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.PLAY"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->c()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    :cond_3
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.PAUSE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_4

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->d()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.PAUSE"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    :cond_4
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.SKIP"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->f()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    :cond_5
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.STOP"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_6

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->h()V

    goto :goto_0

    :cond_6
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.REWIND"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_7

    invoke-virtual {p0}, Lcom/xingbook/ting/play/MusicService;->e()V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    :cond_7
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.ACTION_SELECTED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_8

    invoke-virtual {p0, p1}, Lcom/xingbook/ting/play/MusicService;->a(Landroid/content/Intent;)V

    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.musicservice.action.START"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/play/MusicService;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    :cond_8
    const-string v1, "com.111.xingpark.ting.play.musicservice.action.ACTION_SHUTDOWN_DELAY"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "time"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    invoke-direct {p0, v0}, Lcom/xingbook/ting/play/MusicService;->b(I)V

    goto/16 :goto_0
.end method
